<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>角色权限 - 拖拽式建站平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }

        :root {
            --sidebar-width: 240px;
            --header-height: 64px;
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --bg-color: #f5f6f7;
            --card-bg: #ffffff;
            --text-primary: #18191c;
            --text-secondary: #61666d;
            --text-muted: #9499a0;
            --border-color: #e3e5e7;
            --success-color: #27ae60;
            --warning-color: #f39c12;
            --danger-color: #e74c3c;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-primary);
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
        }

        /* 顶部导航栏 */
        .header {
            height: var(--header-height);
            background: var(--card-bg);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            border-bottom: 1px solid var(--border-color);
            z-index: 100;
        }

        .header-left {
            display: flex;
            align-items: center;
        }

        .sidebar-toggle {
            margin-right: 16px;
            cursor: pointer;
            color: var(--text-secondary);
            font-size: 18px;
        }

        .logo {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
        }

        .logo i {
            margin-right: 10px;
            color: var(--primary-color);
        }

        .header-right {
            display: flex;
            align-items: center;
        }

        .header-action {
            margin-left: 16px;
            color: var(--text-secondary);
            cursor: pointer;
            position: relative;
        }

        .header-action:hover {
            color: var(--primary-color);
        }

        .badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background: var(--danger-color);
            color: white;
            font-size: 11px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .user-menu {
            display: flex;
            align-items: center;
            margin-left: 20px;
            cursor: pointer;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 12px;
        }

        /* 主内容区域 */
        .main-container {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        /* 侧边栏 */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--card-bg);
            border-right: 1px solid var(--border-color);
            overflow-y: auto;
            transition: all 0.3s ease;
        }

        .sidebar-menu {
            padding: 16px 0;
        }

        .menu-title {
            padding: 10px 20px;
            font-size: 13px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .menu-item {
            display: flex;
            align-items: center;
            padding: 12px 20px;
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }

        .menu-item:hover {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
        }

        .menu-item.active {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
            border-left-color: var(--primary-color);
        }

        .menu-item i {
            margin-right: 12px;
            width: 18px;
            text-align: center;
        }

        /* 内容区域 */
        .content {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }

        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .page-title {
            font-size: 24px;
            font-weight: 600;
        }

        .page-actions .btn {
            margin-left: 10px;
        }

        /* 选项卡导航 */
        .tabs-nav {
            display: flex;
            border-bottom: 1px solid var(--border-color);
            margin-bottom: 20px;
        }

        .tab-item {
            padding: 12px 24px;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            font-weight: 500;
            color: var(--text-secondary);
            transition: all 0.3s ease;
        }

        .tab-item:hover {
            color: var(--primary-color);
        }

        .tab-item.active {
            color: var(--primary-color);
            border-bottom-color: var(--primary-color);
        }

        /* 角色权限内容区域 */
        .roles-container {
            display: flex;
            flex: 1;
            gap: 20px;
        }

        /* 角色列表 */
        .roles-list {
            flex: 1;
            background: var(--card-bg);
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            flex-direction: column;
            min-width: 300px;
        }

        .list-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .list-title {
            font-size: 16px;
            font-weight: 500;
        }

        .list-actions {
            display: flex;
            gap: 8px;
        }

        .roles-items {
            overflow-y: auto;
            flex: 1;
        }

        .role-item {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            cursor: pointer;
            transition: background 0.3s ease;
        }

        .role-item:hover {
            background: rgba(52, 152, 219, 0.05);
        }

        .role-item.selected {
            background: rgba(52, 152, 219, 0.1);
            border-right: 3px solid var(--primary-color);
        }

        .role-name {
            font-weight: 500;
            margin-bottom: 6px;
            display: flex;
            align-items: center;
        }

        .role-name i {
            margin-right: 8px;
            color: var(--primary-color);
        }

        .role-meta {
            display: flex;
            align-items: center;
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 8px;
            flex-wrap: wrap;
        }

        .role-meta-item {
            display: flex;
            align-items: center;
            margin-right: 16px;
        }

        .role-meta-item i {
            margin-right: 4px;
        }

        .role-desc {
            font-size: 13px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        /* 权限详情区域 */
        .permissions-detail {
            flex: 2;
            background: var(--card-bg);
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            flex-direction: column;
            min-width: 400px;
        }

        .detail-header {
            padding: 20px;
            border-bottom: 1px solid var(--border-color);
        }

        .detail-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 16px;
        }

        .detail-name {
            font-size: 20px;
            font-weight: 600;
        }

        .detail-actions {
            display: flex;
            gap: 8px;
        }

        .detail-content {
            padding: 20px;
            flex: 1;
            overflow-y: auto;
        }

        .detail-section {
            margin-bottom: 24px;
        }

        .section-title {
            font-size: 16px;
            font-weight: 500;
            margin-bottom: 16px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
        }

        .section-title i {
            margin-right: 8px;
            color: var(--primary-color);
        }

        /* 权限模块 */
        .permission-module {
            margin-bottom: 20px;
            background: #f9fafc;
            border-radius: 4px;
            overflow: hidden;
        }

        .module-header {
            padding: 12px 16px;
            background: #e8f4ff;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
        }

        .module-title {
            font-weight: 500;
            display: flex;
            align-items: center;
        }

        .module-title i {
            margin-right: 8px;
            color: var(--primary-color);
        }

        .module-actions {
            display: flex;
            align-items: center;
        }

        .module-content {
            padding: 16px;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 12px;
        }

        .permission-item {
            display: flex;
            align-items: center;
            padding: 8px 12px;
            background: white;
            border-radius: 4px;
            border: 1px solid var(--border-color);
        }

        .permission-check {
            margin-right: 10px;
        }

        .permission-info {
            flex: 1;
        }

        .permission-name {
            font-weight: 500;
            font-size: 14px;
            margin-bottom: 2px;
        }

        .permission-desc {
            font-size: 12px;
            color: var(--text-muted);
        }

        /* 用户分配区域 */
        .users-section {
            background: #f9fafc;
            border-radius: 4px;
            padding: 16px;
        }

        .users-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }

        .users-title {
            font-weight: 500;
        }

        .users-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 12px;
        }

        .user-card {
            background: white;
            border-radius: 4px;
            padding: 12px;
            border: 1px solid var(--border-color);
            display: flex;
            align-items: center;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 12px;
            flex-shrink: 0;
        }

        .user-info {
            flex: 1;
        }

        .user-name {
            font-weight: 500;
            font-size: 14px;
            margin-bottom: 2px;
        }

        .user-email {
            font-size: 12px;
            color: var(--text-muted);
        }

        .user-action {
            margin-left: 8px;
            color: var(--danger-color);
            cursor: pointer;
        }

        /* 表单样式 */
        .form-group {
            margin-bottom: 16px;
        }

        .form-label {
            display: block;
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 6px;
            font-weight: 500;
        }

        .form-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
        }

        .form-textarea {
            min-height: 80px;
            resize: vertical;
        }

        .form-select {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            background: white;
            font-size: 14px;
        }

        /* 按钮样式 */
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .btn i {
            margin-right: 6px;
        }

        .btn-primary {
            background: var(--primary-color);
            color: white;
        }

        .btn-primary:hover {
            background: #2980b9;
        }

        .btn-outline {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
        }

        .btn-outline:hover {
            background: #f5f7fa;
        }

        .btn-success {
            background: var(--success-color);
            color: white;
        }

        .btn-success:hover {
            background: #219653;
        }

        .btn-danger {
            background: var(--danger-color);
            color: white;
        }

        .btn-danger:hover {
            background: #c0392b;
        }

        .btn-sm {
            padding: 4px 8px;
            font-size: 13px;
        }

        .btn-icon {
            width: 32px;
            height: 32px;
            padding: 0;
            justify-content: center;
        }

        .btn-icon i {
            margin-right: 0;
        }

        /* 空状态 */
        .empty-state {
            padding: 40px 20px;
            text-align: center;
            color: var(--text-muted);
        }

        .empty-state i {
            font-size: 48px;
            margin-bottom: 16px;
            color: #d1d5db;
        }

        /* 响应式设计 */
        @media (max-width: 992px) {
            .roles-container {
                flex-direction: column;
            }

            .permissions-detail {
                min-width: auto;
            }

            .sidebar {
                position: fixed;
                left: -var(--sidebar-width);
                top: var(--header-height);
                bottom: 0;
                z-index: 90;
            }

            .sidebar.open {
                left: 0;
            }

            .overlay {
                position: fixed;
                top: var(--header-height);
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 80;
                display: none;
            }

            .overlay.open {
                display: block;
            }
        }

        @media (max-width: 768px) {
            .module-content {
                grid-template-columns: 1fr;
            }

            .users-list {
                grid-template-columns: 1fr;
            }

            .page-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .page-actions {
                margin-top: 16px;
                width: 100%;
                display: flex;
                justify-content: space-between;
            }

            .page-actions .btn {
                margin-left: 0;
                flex: 1;
                margin: 0 5px;
            }

            .tabs-nav {
                overflow-x: auto;
                white-space: nowrap;
            }
        }
    </style>
</head>

<body>
    <!-- 顶部导航栏 -->
    <div class="header">
        <div class="header-left">
            <div class="sidebar-toggle">
                <i class="fas fa-bars"></i>
            </div>
            <div class="logo">
                <i class="fas fa-puzzle-piece"></i>
                拖拽建站后台
            </div>
        </div>

        <div class="header-right">
            <div class="header-action">
                <i class="fas fa-bell"></i>
                <span class="badge">3</span>
            </div>

            <div class="header-action">
                <i class="fas fa-envelope"></i>
                <span class="badge">5</span>
            </div>

            <div class="user-menu">
                <span>管理员</span>
                <div class="user-avatar">
                    <i class="fas fa-user"></i>
                </div>
            </div>
        </div>
    </div>

    <!-- 主内容区域 -->
    <div class="main-container">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-menu">
                <div class="menu-title">主导航</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-home"></i>
                    <span>控制台</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-paint-brush"></i>
                    <span>网站管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-file-alt"></i>
                    <span>页面管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-th-large"></i>
                    <span>组件库</span>
                </a>

                <div class="menu-title">内容管理</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-newspaper"></i>
                    <span>文章管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-box"></i>
                    <span>产品管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-images"></i>
                    <span>媒体库</span>
                </a>

                <div class="menu-title">用户与权限</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-users"></i>
                    <span>用户管理</span>
                </a>
                <a href="#" class="menu-item active">
                    <i class="fas fa-shield-alt"></i>
                    <span>角色权限</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-cog"></i>
                    <span>系统设置</span>
                </a>
            </div>
        </div>

        <!-- 内容区域 -->
        <div class="content">
            <div class="page-header">
                <h1 class="page-title">角色权限管理</h1>
                <div class="page-actions">
                    <button class="btn btn-outline">
                        <i class="fas fa-download"></i> 导出权限
                    </button>
                    <button class="btn btn-primary">
                        <i class="fas fa-plus"></i> 新建角色
                    </button>
                </div>
            </div>

            <!-- 选项卡导航 -->
            <div class="tabs-nav">
                <div class="tab-item active">角色管理</div>
                <div class="tab-item">权限分配</div>
                <div class="tab-item">用户分配</div>
                <div class="tab-item">操作日志</div>
            </div>

            <!-- 角色权限区域 -->
            <div class="roles-container">
                <!-- 角色列表 -->
                <div class="roles-list">
                    <div class="list-header">
                        <div class="list-title">角色列表</div>
                        <div class="list-actions">
                            <button class="btn btn-icon btn-outline" title="刷新">
                                <i class="fas fa-sync-alt"></i>
                            </button>
                        </div>
                    </div>

                    <div class="roles-items">
                        <div class="role-item selected">
                            <div class="role-name">
                                <i class="fas fa-crown"></i>
                                超级管理员
                            </div>
                            <div class="role-meta">
                                <div class="role-meta-item">
                                    <i class="fas fa-users"></i> 3 用户
                                </div>
                                <div class="role-meta-item">
                                    <i class="fas fa-key"></i> 45 权限
                                </div>
                            </div>
                            <div class="role-desc">拥有系统所有权限，可管理所有资源和用户</div>
                        </div>

                        <div class="role-item">
                            <div class="role-name">
                                <i class="fas fa-user-shield"></i>
                                管理员
                            </div>
                            <div class="role-meta">
                                <div class="role-meta-item">
                                    <i class="fas fa-users"></i> 5 用户
                                </div>
                                <div class="role-meta-item">
                                    <i class="fas fa-key"></i> 32 权限
                                </div>
                            </div>
                            <div class="role-desc">拥有大部分管理权限，不能管理系统用户和角色</div>
                        </div>

                        <div class="role-item">
                            <div class="role-name">
                                <i class="fas fa-user-tie"></i>
                                内容编辑
                            </div>
                            <div class="role-meta">
                                <div class="role-meta-item">
                                    <i class="fas fa-users"></i> 8 用户
                                </div>
                                <div class="role-meta-item">
                                    <i class="fas fa-key"></i> 18 权限
                                </div>
                            </div>
                            <div class="role-desc">可以创建和编辑内容，但不能发布或删除</div>
                        </div>

                        <div class="role-item">
                            <div class="role-name">
                                <i class="fas fa-user-edit"></i>
                                作者
                            </div>
                            <div class="role-meta">
                                <div class="role-meta-item">
                                    <i class="fas fa-users"></i> 12 用户
                                </div>
                                <div class="role-meta-item">
                                    <i class="fas fa-key"></i> 10 权限
                                </div>
                            </div>
                            <div class="role-desc">可以创建和编辑自己的内容，需要审核才能发布</div>
                        </div>

                        <div class="role-item">
                            <div class="role-name">
                                <i class="fas fa-user"></i>
                                订阅者
                            </div>
                            <div class="role-meta">
                                <div class="role-meta-item">
                                    <i class="fas fa-users"></i> 45 用户
                                </div>
                                <div class="role-meta-item">
                                    <i class="fas fa-key"></i> 5 权限
                                </div>
                            </div>
                            <div class="role-desc">可以查看特定内容和基本个人资料管理</div>
                        </div>
                    </div>
                </div>

                <!-- 权限详情区域 -->
                <div class="permissions-detail">
                    <div class="detail-header">
                        <div class="detail-title">
                            <div class="detail-name">超级管理员权限</div>
                            <div class="detail-actions">
                                <button class="btn btn-icon btn-outline" title="编辑">
                                    <i class="fas fa-edit"></i>
                                </button>
                                <button class="btn btn-icon btn-outline" title="复制角色">
                                    <i class="fas fa-copy"></i>
                                </button>
                            </div>
                        </div>
                        <div class="role-desc">拥有系统所有权限，可管理所有资源和用户</div>
                    </div>

                    <div class="detail-content">
                        <div class="detail-section">
                            <div class="section-title">
                                <i class="fas fa-key"></i>
                                权限配置
                            </div>

                            <div class="permission-module">
                                <div class="module-header">
                                    <div class="module-title">
                                        <i class="fas fa-tachometer-alt"></i>
                                        控制台权限
                                    </div>
                                    <div class="module-actions">
                                        <label class="form-check" style="font-size: 13px;">
                                            <input type="checkbox" class="form-check-input" checked>
                                            全选
                                        </label>
                                    </div>
                                </div>
                                <div class="module-content">
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">查看控制台</div>
                                            <div class="permission-desc">访问系统控制台主页</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">查看统计数据</div>
                                            <div class="permission-desc">查看系统统计和分析数据</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">导出数据</div>
                                            <div class="permission-desc">导出系统各种数据报表</div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="permission-module">
                                <div class="module-header">
                                    <div class="module-title">
                                        <i class="fas fa-paint-brush"></i>
                                        网站管理权限
                                    </div>
                                    <div class="module-actions">
                                        <label class="form-check" style="font-size: 13px;">
                                            <input type="checkbox" class="form-check-input" checked>
                                            全选
                                        </label>
                                    </div>
                                </div>
                                <div class="module-content">
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">创建网站</div>
                                            <div class="permission-desc">创建新的网站项目</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">编辑网站</div>
                                            <div class="permission-desc">修改网站基本设置</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">删除网站</div>
                                            <div class="permission-desc">永久删除网站项目</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">发布网站</div>
                                            <div class="permission-desc">将网站发布到线上</div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="permission-module">
                                <div class="module-header">
                                    <div class="module-title">
                                        <i class="fas fa-file-alt"></i>
                                        内容管理权限
                                    </div>
                                    <div class="module-actions">
                                        <label class="form-check" style="font-size: 13px;">
                                            <input type="checkbox" class="form-check-input" checked>
                                            全选
                                        </label>
                                    </div>
                                </div>
                                <div class="module-content">
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">创建内容</div>
                                            <div class="permission-desc">创建新的文章和页面</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">编辑内容</div>
                                            <div class="permission-desc">修改所有用户的内容</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">删除内容</div>
                                            <div class="permission-desc">永久删除内容</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">审核内容</div>
                                            <div class="permission-desc">审核和批准内容发布</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">管理分类</div>
                                            <div class="permission-desc">创建和管理内容分类</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">管理标签</div>
                                            <div class="permission-desc">创建和管理内容标签</div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="permission-module">
                                <div class="module-header">
                                    <div class="module-title">
                                        <i class="fas fa-users"></i>
                                        用户管理权限
                                    </div>
                                    <div class="module-actions">
                                        <label class="form-check" style="font-size: 13px;">
                                            <input type="checkbox" class="form-check-input" checked>
                                            全选
                                        </label>
                                    </div>
                                </div>
                                <div class="module-content">
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">创建用户</div>
                                            <div class="permission-desc">创建新的用户账户</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">编辑用户</div>
                                            <div class="permission-desc">修改用户资料和信息</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">删除用户</div>
                                            <div class="permission-desc">永久删除用户账户</div>
                                        </div>
                                    </div>
                                    <div class="permission-item">
                                        <input type="checkbox" class="permission-check" checked>
                                        <div class="permission-info">
                                            <div class="permission-name">分配角色</div>
                                            <div class="permission-desc">为用户分配系统角色</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="detail-section">
                            <div class="section-title">
                                <i class="fas fa-user-friends"></i>
                                已分配用户
                            </div>

                            <div class="users-section">
                                <div class="users-header">
                                    <div class="users-title">3 位用户拥有此角色</div>
                                    <button class="btn btn-sm btn-outline">
                                        <i class="fas fa-plus"></i> 添加用户
                                    </button>
                                </div>

                                <div class="users-list">
                                    <div class="user-card">
                                        <div class="user-avatar">A</div>
                                        <div class="user-info">
                                            <div class="user-name">Admin User</div>
                                            <div class="user-email">admin@example.com</div>
                                        </div>
                                        <div class="user-action" title="移除角色">
                                            <i class="fas fa-times"></i>
                                        </div>
                                    </div>

                                    <div class="user-card">
                                        <div class="user-avatar">S</div>
                                        <div class="user-info">
                                            <div class="user-name">System Admin</div>
                                            <div class="user-email">system@example.com</div>
                                        </div>
                                        <div class="user-action" title="移除角色">
                                            <i class="fas fa-times"></i>
                                        </div>
                                    </div>

                                    <div class="user-card">
                                        <div class="user-avatar">R</div>
                                        <div class="user-info">
                                            <div class="user-name">Root User</div>
                                            <div class="user-email">root@example.com</div>
                                        </div>
                                        <div class="user-action" title="移除角色">
                                            <i class="fas fa-times"></i>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="detail-section">
                            <button class="btn btn-primary">
                                <i class="fas fa-save"></i> 保存更改
                            </button>
                            <button class="btn btn-outline">
                                <i class="fas fa-times"></i> 取消
                            </button>
                            <button class="btn btn-danger" style="float: right;">
                                <i class="fas fa-trash"></i> 删除角色
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 移动端遮罩层 -->
    <div class="overlay"></div>

    <script>
        // 简单的交互效果
        document.addEventListener('DOMContentLoaded', function () {
            // 角色选择
            const roleItems = document.querySelectorAll('.role-item');
            roleItems.forEach(item => {
                item.addEventListener('click', function () {
                    roleItems.forEach(r => r.classList.remove('selected'));
                    this.classList.add('selected');

                    // 更新右侧详情区域（实际应用中会加载对应角色的数据）
                    const roleName = this.querySelector('.role-name').textContent.trim();
                    document.querySelector('.detail-name').textContent = roleName + '权限';
                });
            });

            // 选项卡切换
            const tabItems = document.querySelectorAll('.tab-item');
            tabItems.forEach(tab => {
                tab.addEventListener('click', function () {
                    tabItems.forEach(t => t.classList.remove('active'));
                    this.classList.add('active');
                });
            });

            // 权限模块折叠/展开
            const moduleHeaders = document.querySelectorAll('.module-header');
            moduleHeaders.forEach(header => {
                header.addEventListener('click', function () {
                    const content = this.nextElementSibling;
                    if (content.style.display === 'none') {
                        content.style.display = 'grid';
                    } else {
                        content.style.display = 'none';
                    }
                });
            });

            // 侧边栏切换（移动端）
            const sidebarToggle = document.querySelector('.sidebar-toggle');
            const sidebar = document.querySelector('.sidebar');
            const overlay = document.querySelector('.overlay');

            sidebarToggle.addEventListener('click', function () {
                sidebar.classList.toggle('open');
                overlay.classList.toggle('open');
            });

            overlay.addEventListener('click', function () {
                sidebar.classList.remove('open');
                overlay.classList.remove('open');
            });
        });
    </script>
</body>

</html>